package com.service.imp;


import java.util.List;

import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.pojo.RoomStatus;
import com.pojo.Roominfo;
import com.service.SearchService;


public class TestSearchServiceImp {
	ApplicationContext ac;
	SearchService ss ;
	RoomStatus rs;
	Roominfo roominfo;
	@Before
	public void init (){
		ac = new ClassPathXmlApplicationContext("ApplicationContext.xml");
		ss = (SearchService)ac.getBean("searchService");
		roominfo = new Roominfo();
	}
	@Test
	public void TestgetRoomStatusDaoImp (){
		rs = ss.getRoomStatusById(1);
		System.out.println(rs.getId());
		
	}
	@Test
	public void TestgetRoominfoByAdd(){
		 roominfo = ss.getRoominfoByAdd("26", "-1", "065");
		 System.out.println(roominfo.getId());
		
	}
	
	@Test
	public void TestgetfloorByBuildingNum(){
		List<String> list = ss.getfloorByBuildingNum("26");
		for(String tem:list){
			System.out.println(tem+"====");
		}
	}
	
	@Test
	public void TestgetroomNumByBuildingNumAndFloor(){
		List<String> list = ss.getroomNumByBuildingNumAndFloor("26", "-1");
		for(String tem:list){
			System.out.println(tem+"====");
		}
	}
	
/*	@Test
	public void TestGetRoomStatusBydate() throws ParseException{
		SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd");
		Date beginDate = sdf.parse("2012-12-18");
		Date endDate = sdf.parse("2012-12-20");
		System.out.println(beginDate);
		System.out.println(endDate);
		//List<RoomStatus> list = ss.getRoomStatusByDate(beginDate, endDate);
		//System.out.println(list.size());
	}*/
	
	
}
